<template>
  <div class="readOnlyContent">
    <vxe-table border
               auto-resize
               row-id="id"
               :row-key="true"
               show-overflow="tooltip"
               highlight-hover-row
               align="center"
               header-align="center"
               ref="xTree"
               :loading="Loading"
               :data="tableData">
      <vxe-table-column field="name" title="人员姓名" align="center"/>
      <vxe-table-column field="ssbi0003" title="分类救助上浮类别" align="center"/>
      <vxe-table-column field="ssbi0006" title="上浮比例" align="center" :formatter="renderSsbi0006"/>
      <vxe-table-column field="ssbi0005" title="分类救助金额" align="center"/>
      <vxe-table-column field="ssbi0008" title="高龄补贴金额" align="center"/>
    </vxe-table>


    <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
          @on-change="handleTableChange" :current="pageNo"></Page>

    <vxe-table border
               auto-resize
               row-id="id"
               :row-key="true"
               show-overflow="tooltip"
               highlight-hover-row
               align="center"
               header-align="center"
               ref="xTree"
               :loading="SubtractLoading"
               :data="subtractData">
      <vxe-table-column field="memberName" title="人员姓名" align="center"/>
      <vxe-table-column field="subtractType" title="核减类型" align="center"/>
      <vxe-table-column field="subtractTypeInfo" title="核减类型说明" align="center"/>
      <vxe-table-column field="subtractMoney" title="核减金额" align="center"/>
    </vxe-table>
    <ss11011-modal ref="modalForm" @ok="modalFormOk"/>
  </div>
</template>

<script>
import {getAction, postAction} from '@/api/request'
import {CommonMixin} from '@/views/common/js/CommonMixin'
import '@/views/common/css/common.css';
import Ss11011Modal from '../ss11_create_steps/modules/Ss11011Modal'

export default {
  name: "application11",
  mixins: [CommonMixin],
  components: {Ss11011Modal},
  data() {
    return {
      url: {
        list: "/api/ac/subsistence/ss15011Service/page",
        getSubtract: '/api/ac/subsistence/ss12001Service/createSubtract',
      },
      Loading: false,
      SubtractLoading: false,
      subtractData: [],
      familyInfo: this.$parent.familyInfo,
      queryParam: {},
      columns: [],
    }
  },
  methods: {
    loadSubtractData() {
      postAction(this.url.getSubtract, {ss12001Id: this.familyInfo.ss12001Id, readOnly: true}).then((res) => {
        if (res.data.errcode != 0) {
          this.$Message.error(res.data.errmsg);
        } else {
          this.subtractData = res.data.data;
        }
      }).finally(() => {
        this.SubtractLoading = false;
      })
    },

  },
  created() {
    this.Loading = true;
    this.queryParam.ssbi0002 = this.$parent.familyInfo.ssca0054;
    this.loadData();
    this.loadSubtractData();
  }
}
</script>

<style scoped>

</style>
